<%--
  Created by IntelliJ IDEA.
  User: 10616
  Date: 2024/2/25
  Time: 20:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入jsptl函数库--%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
    <title>添加</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-size: cover;
        }
        h1 {
            text-align: center;
            color: #333;
        }
        form {
            width: 300px;
            margin: 0 auto;
            background-color: rgba(255, 255, 255, 0.8);
            padding: 20px;
            border-radius: 5px;
        }
        input[type="text"], input[type="password"] {
            width: 100%;
            padding: 5px;
            margin-bottom: 10px;
        }
        input[type="radio"], input[type="checkbox"] {
            margin-right: 5px;
        }
        select {
            width: 100%;
            padding: 5px;
            margin-bottom: 10px;
        }
        input[type="submit"] {
            width: 100%;
            padding: 5px;
            background-color: #333;
            color: #fff;
            border: none;
            border-radius: 3px;
            cursor: pointer;
        }
        input[type="submit"]:hover {
            background-color: #555;
        }
    </style>
</head>
<body background="img/OIP-C (7).jpg">
<h1 > 添加</h1>
${msg}
<form action="UserServlet?type=addUser" method="post">
    用户名:<input type="text" name="username" placeholder="请输入用户名" value="${username}"><br/>
    密码:<input type="text" name="password" placeholder="请输入密码" value="${password}"><br/>
    性别:<br/>
    男:<input type="radio" name="sex" value="男" ${sex eq "男"?"checked='checked'":""}><br/>
    女:<input type="radio" name="sex" value="女" ${sex eq "女"?"checked='checked'":""}><br/>
    爱好:<br/>
    学习:<input type="checkbox" name="hobbies" value="学习" ${fn:contains(hobbies,"学习" )?"checked='checked'":""}><br/>
    听歌:<input type="checkbox" name="hobbies" value="听歌" ${fn:contains(hobbies,"听歌" )?"checked='checked'":""}><br/>
    桌球:<input type="checkbox" name="hobbies" value="桌球" ${fn:contains(hobbies,"桌球" )?"checked='checked'":""}><br/>
    沐足:<input type="checkbox" name="hobbies" value="沐足" ${fn:contains(hobbies,"沐足" )?"checked='checked'":""}><br/>
    籍贯:<br/>
    <select name="nativePlace">
        <option value="广东" ${nativePlace eq "广东"?"selected='selected'":""}>广东</option>
        <option value="广西" ${nativePlace eq "广西"?"selected='selected'":""}>广西</option>
        <option value="湖南" ${nativePlace eq "湖南"?"selected='selected'":""}>湖南</option>
        <option value="湖北" ${nativePlace eq "湖北"?"selected='selected'":""}>湖北</option>
    </select><br/>
    <input type="submit" value="添加">
</form>
</body>
</html>
